package org.mod4j.dslcommon.xpand.java;

import org.eclipse.xtext.xbase.lib.StringExtensions;
import org.eclipse.xtext.xtend2.lib.StringConcatenation;

@SuppressWarnings("all")
public class FieldGetterSetter {
  
  public StringConcatenation field(final String type, final String name) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("protected ");
    _builder.append(type, "");
    _builder.append(" ");
    _builder.append(name, "");
    _builder.append(";");
    _builder.newLineIfNotEmpty();
    _builder.newLine();
    _builder.append("/**");
    _builder.newLine();
    _builder.append("\t     ");
    _builder.append("* @param object");
    _builder.newLine();
    _builder.append("\t     ");
    _builder.append("*            The ");
    _builder.append(name, "	     ");
    _builder.append(" to set.");
    _builder.newLineIfNotEmpty();
    _builder.append(" ");
    _builder.append("*/");
    _builder.newLine();
    _builder.append("public void set");
    String _firstUpper = StringExtensions.toFirstUpper(name);
    _builder.append(_firstUpper, "");
    _builder.append("(");
    _builder.append(type, "");
    _builder.append(" object) {");
    _builder.newLineIfNotEmpty();
    _builder.append("    ");
    _builder.append("this.");
    _builder.append(name, "    ");
    _builder.append(" = object;");
    _builder.newLineIfNotEmpty();
    _builder.append("\t    ");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t    ");
    _builder.append("/** ");
    _builder.newLine();
    _builder.append("\t     ");
    _builder.append("* @return The ");
    _builder.append(name, "	     ");
    _builder.append(" to get.");
    _builder.newLineIfNotEmpty();
    _builder.append("\t     ");
    _builder.append("*");
    _builder.newLine();
    _builder.append("\t     ");
    _builder.append("*/");
    _builder.newLine();
    _builder.append("public ");
    _builder.append(type, "");
    _builder.append(" get");
    String _firstUpper_1 = StringExtensions.toFirstUpper(name);
    _builder.append(_firstUpper_1, "");
    _builder.append("() {");
    _builder.newLineIfNotEmpty();
    _builder.append("    ");
    _builder.append("return this.");
    _builder.append(name, "    ");
    _builder.append(";");
    _builder.newLineIfNotEmpty();
    _builder.append("}");
    _builder.newLine();
    return _builder;
  }
  
  public StringConcatenation fieldInheritedd(final String type, final String name) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("protected ");
    _builder.append(type, "");
    _builder.append(" ");
    _builder.append(name, "");
    _builder.append(";");
    _builder.newLineIfNotEmpty();
    _builder.newLine();
    _builder.append("\t    ");
    _builder.append("/**");
    _builder.newLine();
    _builder.append("\t     ");
    _builder.append("* {@inheritDoc}");
    _builder.newLine();
    _builder.append(" ");
    _builder.append("*/");
    _builder.newLine();
    _builder.append("public void set");
    String _firstUpper = StringExtensions.toFirstUpper(name);
    _builder.append(_firstUpper, "");
    _builder.append("(");
    _builder.append(type, "");
    _builder.append(" object) {");
    _builder.newLineIfNotEmpty();
    _builder.append("    ");
    _builder.append("this.");
    _builder.append(name, "    ");
    _builder.append(" = object;");
    _builder.newLineIfNotEmpty();
    _builder.append("\t    ");
    _builder.append("}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t    ");
    _builder.append("/**");
    _builder.newLine();
    _builder.append("\t     ");
    _builder.append("* {@inheritDoc}");
    _builder.newLine();
    _builder.append(" ");
    _builder.append("*/");
    _builder.newLine();
    _builder.append("public ");
    _builder.append(type, "");
    _builder.append(" get");
    String _firstUpper_1 = StringExtensions.toFirstUpper(name);
    _builder.append(_firstUpper_1, "");
    _builder.append("() {");
    _builder.newLineIfNotEmpty();
    _builder.append("    ");
    _builder.append("return this.");
    _builder.append(name, "    ");
    _builder.append(";");
    _builder.newLineIfNotEmpty();
    _builder.append("}");
    _builder.newLine();
    return _builder;
  }
}